<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<div id="top" class="box">
			啊哈哈
		</div>
	</body>
	<script type="text/javascript">
		var box = document.getElementsByTagName("div");
		var box = document.getElementById("top");
//		var box = document.getElementsByClassName("box");
//		var box = document.querySelector("#top");
		var box = document.querySelector(".box");
		
		box.style.backgroundColor = "red";
		console.log(box)
		
		
	</script>
</html>
